<div id="bands">
  <% if artist.bands.empty? %>
    There are no bands for this artist. Know of one?
  <% end %>

    <strong><%= link_to 'Add a Band', new_artist_membership_path(artist), :class => 'lightwindow',
																		  :params => "lightwindow_type=page,lightwindow_width=600,lightwindow_height=400"%>
	</strong>
	<br />

  <% if !artist.bands.empty? %>    
    <%- artist.bands.each do |band| -%>

      <div class="edit-band-pane">
 
        <% if band.band.primary_image.nil? %>
          <img src="/images/REDUX.jpg" alt="Band Art" width="100" height="100">
        <% else %>
          <%= image_tag band.band.primary_image.url(:medium) %>
        <% end %>

        <%= link_to band.band.name, band.band %>

        <span class="band-pane-controls">
          <%= link_to 'x', membership_path(band), :method => :delete %> |
          <%= link_to 'Edit', edit_membership_path(band), :artist_id => artist.id,
														  :class => 'lightwindow',
														  :params => "lightwindow_type=page,lightwindow_width=600,lightwindow_height=400" %>
          &nbsp;
        </span>
        <br />

		<% band.membership_dates.each do |d| %>
		  <%=h d.event %>:
		  <%=h d.date_string_with_month %>
		  <br />
		<% end %>
        Role:<%=h band.role %><br />
      </div><!-- /band-pane -->
  <%- end -%>
<% end %>

</div><!-- bands -->
